/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package escom.ipn.modelo.delegate;

import com.mysql.jdbc.Connection;
import escom.ipn.modelo.dto.RadioClass;
import escom.ipn.modelo.facade.adminRadioFacade;
import escom.ipn.modelo.facade.adminSectorFacade;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.List;
import java.util.ResourceBundle;


/**
 *
 * @author db2admin
 */
public class adminRadioDelegate {
    
    private Connection cnn;
    private adminRadioFacade apf;
    
    public adminRadioDelegate(){
        ResourceBundle recursos = ResourceBundle.getBundle("escom.ipn.Recursos.Recursos");
        String usuario=recursos.getString("user");
        String clave=recursos.getString("pass");
        String url=recursos.getString("url");
        String driver=recursos.getString("driver");
        try{
            Class.forName(driver);
            cnn = (Connection) DriverManager.
                    getConnection(url,usuario,clave);
        }catch(Exception e){
            e.printStackTrace(); 
        }
        apf=new adminRadioFacade(cnn);
    }
    
    public List getRadios() throws SQLException{
        return apf.getRadios();
    }
    public List getRadioNOMBRE(RadioClass a) throws SQLException{
        return apf.getRadioNOMBRE(a);
    }
    
    public List getRadioID(RadioClass a) throws SQLException{
        return apf.getRadioID(a);
    }
    
    public void asignacion(RadioClass a) throws SQLException{
         apf.asignacion(a);
    }
    
}
